load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("//build:wabt_build.bzl", "WABT_CXXOPTS")

[cc_binary(
    name = tool,
    srcs = [tool + ".cc"],
    cxxopts = WABT_CXXOPTS,
    visibility = ["//visibility:public"],
    deps = [
        "//src:wabt",
    ],
) for tool in [
    "wasm-decompile",
    "wasm-objdump",
    "wasm-stats",
    "wasm-strip",
    "wasm-validate",
    "wasm2wat",
    "wast2json",
    "wat-desugar",
    "wat2wasm",
]]

[cc_binary(
    name = tool,
    srcs = [tool + ".cc"],
    cxxopts = WABT_CXXOPTS,
    visibility = ["//visibility:public"],
    deps = [
        "//src:wabt",
        "//src:wabt_interp",
    ],
) for tool in [
    "spectest-interp",
    "wasm-interp",
]]

cc_binary(
    name = "wasm2c",
    srcs = ["wasm2c.cc"],
    cxxopts = WABT_CXXOPTS,
    visibility = ["//visibility:public"],
    deps = [
        "//src:wabt",
        "//src:wabt_prebuilt_wasm2c",
    ],
)
